@page "{id}"
@using FytSoa.Application.Exam
@using FytSoa.Application.Exam.Param
@inject ExamTeacherService _teacherService
@inject ExamCourseService _courseService
@{
    ViewData["Nav"] = 4;
    var id = RouteData.Values["id"]?.ToString();
    await _teacherService.ModifyAddHitsAsync(long.Parse(id));
    var teacher = await _teacherService.GetAsync(long.Parse(id));
    ViewData["Title"] = "讲师-"+teacher.Name;
    var liveList = await _courseService.GetPagesAsync(new ExamCourseSearchParam()
    {
        Limit = 10,
        TeacherId = long.Parse(id)
    });
    var page = Request.Query["page"];
    page = string.IsNullOrEmpty(page) ? "1" : page.ToString();
    var videoList = await _courseService.GetPagesAsync(new ExamCourseSearchParam()
    {
        Limit = 8,
        Page = int.Parse(page),
        TeacherId = long.Parse(id)
    });
}
<div class="channal">
    <div class="channal-cover">

        <!-- channal cover -->
        <img src="/assets/images/channnal-cover.jpg" alt="">

    </div>

    <div class="main_content_inner">
        <div class="channal-details">
            <div class="left-side">
                <div class="channal-image">
                    <a href="javascript:void(0)">
                        <img src="@teacher.Avatar.UrlReplace()" alt="">
                    </a>
                </div>
                <div class="channal-details-info">
                    <h3>@Html.Raw(teacher.Name) </h3>
                    <p> @Html.Raw(teacher.PostName) - @Html.Raw(teacher.ProfessionCode.Name) </p>
                </div>
            </div>
            <div class="right-side">
                <div class="btn-subscribe">
                    <a href="javascript:void(0)" class="button primary add-focus">
                        <i class="icon-feather-plus"></i> 关注
                    </a>
                    <span class="subs-amount">@teacher.Focus</span>
                </div>
            </div>
        </div>

        <div class="nav-channal" k-sticky="offset:61;media : @@s">
            <nav class="responsive-tab">
                <ul>
                    <li class="uk-active">
                        <a class="active" href="javascript:void(0)">Home</a>
                    </li>
                </ul>
            </nav>
            <form class="nav-channal-saerchbox">
                <i class="uil-search"></i>
                <input class="uk-input" type="text" placeholder="Search Video..." value="">
                <input type="hidden" class="lecut-id" value="@id" />
                @Html.AntiForgeryToken()
            </form>
        </div>
    </div>


</div>

<div class="main_content_inner">


    <!-- feature video-->
    <div class="uk-grid-large" uk-grid>
        <div class="uk-width-3-4@m">

            <h3> 个人介绍 </h3>

            <div class="uk-card uk-grid-collapse uk-child-width-1-2@s uk-margin" uk-grid>
                <div class="uk-card-media-left uk-cover-container">
                    <div class="embed-video">
                        <video src="https://fastly.jsdelivr.net/gh/scuiadmin/CDN/video/scui-player-demo-720.mp4" controls playsinline uk-video></video>
                    </div>
                </div>
                <div>
                    <div class="pl-lg-5 mt-sm-3">
                        @Html.Raw(teacher.Summary)
                    </div>
                </div>
            </div>

        </div>
        <div class="uk-width-expand">

            <h5> 统计数据 </h5>
            <ul class="uk-list">
                <li> @teacher.CreateTime.ToShortDateString() 加入 </li>
                <li> @(teacher.Hits)的浏览量 </li>
                <li> @(liveList.TotalItems)个直播 </li>
                <li> @(videoList.TotalItems)个视频</li>
            </ul>

        </div>
    </div>

    <div class="section-small">
        <h3> 讲师 - 直播 </h3>

        <div class="video-grid-slider" uk-slider="finite: true">
            <ul class="uk-slider-items uk-child-width-1-4@m uk-child-width-1-3@s uk-grid">
                @{
                    foreach (var item in liveList.Items)
                    {
                        <li>
                            <a href="single-video.html" class="video-post">
                                <!-- Blog Post Thumbnail -->
                                <div class="video-post-thumbnail">
                                    <span class="video-post-count">@item.Hits</span>
                                    <span class="video-post-time"></span>
                                    <span class="play-btn-trigger"></span>
                                    <!-- option menu -->
                                    <span class="btn-option">
                                        <i class="icon-feather-more-vertical"></i>
                                    </span>
                                    <div class="dropdown-option-nav"
                                         uk-dropdown="pos: bottom-right ;mode : hover ;animation: uk-animation-slide-bottom-small">
                                        <ul>
                                            <li>
                                                <span> <i class="uil-history"></i> 立即观看</span>
                                            </li>
                                            <li>
                                                <span> <i class="uil-bookmark"></i> 加入书签</span>
                                            </li>
                                            <li>
                                                <span> <i class="uil-share-alt"></i> 分享</span>
                                            </li>
                                        </ul>
                                    </div>

                                    <img src="@item.Cover.UrlReplace()" alt="@Html.Raw(item.Title)">

                                </div>

                                <!-- Blog Post Content -->
                                <div class="video-post-content">
                                    <h3> @Html.Raw(item.Title) </h3>
                                    <img src="@item.Teacher.Avatar.UrlReplace()" alt="@Html.Raw(item.Teacher.Name)">
                                    <span class="video-post-user">@Html.Raw(item.Teacher.Name)</span>
                                    <span class="video-post-views">@Html.Raw(item.Teacher.PostName)</span>
                                    <span class="video-post-date"> @item.Teacher.Age </span>
                                </div>
                            </a>
                        </li>
                    }
                }
            </ul>

            <a class="uk-position-center-left uk-position-small uk-hidden-hover slidenav-prev" href="#"
               uk-slider-item="previous">
            </a>
            <a class="uk-position-center-right uk-position-small uk-hidden-hover slidenav-next" href="#"
               uk-slider-item="next">
            </a>


        </div>

    </div>

    <div class="section-small">

        <h3> 讲师 - 点播 </h3>

        <div class="uk-child-width-1-4@m mb-11" uk-grid
             uk-scrollspy="target: > div; cls: uk-animation-slide-bottom-small; delay: 100">
            @{
                foreach (var item in videoList.Items)
                {
                    <div>
                        <a href="single-video.html" class="video-post">
                            <!-- Blog Post Thumbnail -->
                            <div class="video-post-thumbnail">
                                <span class="video-post-count">@item.Hits</span>
                                <span class="video-post-time"></span>
                                <span class="play-btn-trigger"></span>
                                <!-- option menu -->
                                <span class="btn-option">
                                    <i class="icon-feather-more-vertical"></i>
                                </span>
                                <div class="dropdown-option-nav"
                                     uk-dropdown="pos: bottom-right ;mode : hover ;animation: uk-animation-slide-bottom-small">
                                    <ul>
                                        <li>
                                            <span> <i class="uil-history"></i> 立即观看</span>
                                        </li>
                                        <li>
                                            <span> <i class="uil-bookmark"></i> 加入书签</span>
                                        </li>
                                        <li>
                                            <span> <i class="uil-share-alt"></i> 分享</span>
                                        </li>
                                    </ul>
                                </div>

                                <img src="@item.Cover.UrlReplace()" alt="@Html.Raw(item.Title)">

                            </div>

                            <!-- Blog Post Content -->
                            <div class="video-post-content">
                                <h3> @Html.Raw(item.Title) </h3>
                                <img src="@item.Teacher.Avatar.UrlReplace()" alt="@Html.Raw(item.Teacher.Name)">
                                <span class="video-post-user">@Html.Raw(item.Teacher.Name)</span>
                                <span class="video-post-views">@Html.Raw(item.Teacher.PostName)</span>
                                <span class="video-post-date"> @item.Teacher.Age </span>
                            </div>
                        </a>
                    </div>
                }
            }

        </div>

        <ul class="uk-pagination my-5 uk-flex-center" uk-margin>
            @Html.Raw(PageUtils.Htmls(int.Parse(page),8,Convert.ToInt32(videoList.TotalPages),"/lecturer/single/"+id))
        </ul>

    </div>
</div>
@section Scripts{
    <script src="/assets/js/lecturer.js" type="text/javascript"></script>
}